Bug 558586 – handling of keyboard under darwin (quartz)
authorRichard Hult <richard@imendio.com>
Wed, 12 Nov 2008 12:56:17 +0000 (12:56 +0000)
committerRichard Hult <rhult@src.gnome.org>
Wed, 12 Nov 2008 12:56:17 +0000 (12:56 +0000)
2008-11-12  Richard Hult  <richard@imendio.com>

Bug 558586 – handling of keyboard under darwin (quartz)

* gdk/quartz/gdkkeys-quartz.c: Follow up on this bug, only use the
new API when building on 64-bit, since there are still old non-xml
layouts used out there we don't want to break them. (For 64-bit
those layouts doesn't work so we don't have a choice there.)

svn path=/trunk/; revision=21782

ChangeLog
gdk/quartz/gdkkeys-quartz.c

index 7e55ec4bb1063a7ff5ca8259e6ad3dcb5a641523..23024280c3a9d61edbdf9a8b0e1ebc585944a4b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-11-12  Richard Hult  <richard@imendio.com>
+
+       Bug 558586 – handling of keyboard under darwin (quartz)
+
+       * gdk/quartz/gdkkeys-quartz.c: Follow up on this bug, only use the
+       new API when building on 64-bit, since there are still old non-xml
+       layouts used out there we don't want to break them. (For 64-bit
+       those layouts doesn't work so we don't have a choice there.)
+
 2008-11-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkspinbutton.c: Chain up in enter and leave notify handlers.
index c195780c99a2fcc6c751a1c2d7c5340f6d0acb83..652641baa087677ab2beabe7e3d9026b144985df 100644 (file)
 
 static GdkKeymap *default_keymap = NULL;
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
+/* Note: we could check only if building against the 10.5 SDK instead, but
+ * that would make non-xml layouts not work in 32-bit which would be a quite
+ * bad regression. This way, old unsupported layouts will just not work in
+ * 64-bit.
+ */
+#ifdef __LP64__
 static TISInputSourceRef current_layout = NULL;
 #else
 static KeyboardLayoutRef current_layout = NULL;
@@ -185,7 +190,7 @@ maybe_update_keymap (void)
 {
   const void *chr_data = NULL;
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
+#ifdef __LP64__
   TISInputSourceRef new_layout = TISCopyCurrentKeyboardLayoutInputSource ();
   CFDataRef layout_data_ref;
 
@@ -204,7 +209,7 @@ maybe_update_keymap (void)
       g_free (keyval_array);
       keyval_array = g_new0 (guint, NUM_KEYCODES * KEYVALS_PER_KEYCODE);
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4
+#ifdef __LP64__
       layout_data_ref = (CFDataRef) TISGetInputSourceProperty
        (new_layout, kTISPropertyUnicodeKeyLayoutData);
 
@@ -306,7 +311,7 @@ maybe_update_keymap (void)
        { 
          /* Get chr data */
          KLGetKeyboardLayoutProperty (new_layout, kKLuchrData, (const void **)&chr_data);
-#endif  /* MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 */
+#endif
          
          for (i = 0; i < NUM_KEYCODES; i++) 
            {
@@ -382,7 +387,7 @@ maybe_update_keymap (void)
                  p[1] == p[3])
                p[2] = p[3] = 0;
            }
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+#ifndef __LP64__
        }
       else
        {